FROM rust:latest

ENV RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup
ENV RUSTUP_UPDATE_ROOT=https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup
ENV DEBIAN_FRONTEND=noninteractive

ADD sources.list /etc/apt/
ADD config ~/.cargo/ 
ADD pip.conf ~/.pip/

RUN rm -rf /etc/apt/sources.list.d/*
RUN apt clean 
RUN apt update 
RUN apt install -y git python3 python3-pip python3-venv 
RUN apt clean 
 
WORKDIR /app
COPY . .
RUN chmod +x ./run.sh

RUN python3 -m venv /app/venv
RUN /bin/bash -c "source /app/venv/bin/activate && pip install openai"

CMD ["bash"]
